import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/pages/home/home'
import Detail from '@/pages/detail/detail'
import Order from '@/pages/order/order'
import more from '@/pages/more/more'
import Login from '@/pages/login/Login'
import Register from '@/pages/register/Register'
import All from '@/pages/all/All'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect: '/home',
      leaf: true, // 只有一个节点
      menuShow: true,
      iconCls: 'iconfont icon-home', // 图标样式class
      children: [
        {path: '/home', component: Detail, name: '首页', menuShow: true}
      ]
    },
    {path: '/',
      name: 'Order',
      component: Home,
      menuShow: true,
      leaf: true, // 只有一个节点
      iconCls: 'iconfont icon-users', // 图标样式class
      children: [
        {path: '/order', component: Order, name: '用户列表', menuShow: true}
      ]
    },
    {
      path: '/more',
      name: 'more',
      component: more
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/all',
      name: 'All',
      component: All
    }
  ]
})
